//
//  FavViewController.m
//  Rail
//
//  Created by hychen on 2018/2/25.
//  Copyright © 2018年 Hychen. All rights reserved.
//

#import "FavViewController.h"
#import "MJCSegmentInterface.h"

#import "FavAllViewController.h"
#import "FavLineViewController.h"
#import "FavFactoryViewController.h"
#import "FavDeviceViewController.h"

@interface FavViewController ()

@end

@implementation FavViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    FavAllViewController *allVc = [FavAllViewController new];
    FavLineViewController *lineVc = [FavLineViewController new];
    FavFactoryViewController *factoryVc = [FavFactoryViewController new];
    FavDeviceViewController *deviceVc = [FavDeviceViewController new];
    
    NSArray *vcArray = @[allVc,lineVc,factoryVc,deviceVc];
    NSArray *titleArray = @[@"全部",@"线路",@"工区",@"设备"];
    
    MJCSegmentInterface *interface = [MJCSegmentInterface jc_initWithFrame:CGRectMake(0,0,self.view.jc_width, self.view.jc_height-kStatusBarAndNavBarHeight-kTabbarHeight) interFaceStyleToolsBlock:^(MJCSegmentStylesTools *jc_tools) {
        jc_tools.
        jc_titlesViewFrame(CGRectMake(0, 0, self.view.jc_width, 40)).
        jc_childScollEnabled(NO).
        jc_itemBackColor([UIColor whiteColor]).
        jc_childScollAnimalEnabled(YES).
        jc_itemTextSelectedColor(Color_RGB(0, 193, 224)).
        jc_itemTextNormalColor(Color_RGB(130, 130, 130)).
        jc_itemTextFontSize(14).
        jc_indicatorStyles(MJCIndicatorItemTextStyle).
        jc_itemSelectedSegmentIndex(0).
        jc_indicatorColor(Color_RGB(0, 193, 224)).
        jc_indicatorHidden(NO);
    }];
    
    [self.view addSubview:interface];
    [interface intoTitlesArray:titleArray intoChildControllerArray:vcArray hostController:self];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
